<?php
/* This file is used to link someone's Bobshaker account to a twitter and/or facebook account.
 * Every POST expects _ONE_ twitter or facebook account class
 */

/*
 * $link = new SocialNetworkLink()
 * $link->NetworkUserID = "2398734235325";
 * $link->Media = "facebook";
 */

require "classes.php";
require "includes/db.php";
require "includes/functions.inc.php";

// this will return 10 if no hash found
$bobshakerUserID = RetrieveUserIDFromHash();

if ($_SERVER["REQUEST_METHOD"] != "POST")
    die("Sorry only POST accepted");

if (!isset($_POST["SocialNetworkLink"]))
    die("Sorry no account found that could be linked");

$socialAccountData = json_decode($_POST["SocialNetworkLink"]);

var_dump($socialAccountData);
?>